<template>
    <h1>权益</h1>
    <div>
        <table border="1">
                <thead>
                    <tr>
                        <th>
                            <input type="checkbox" >
                        </th>
                        <th>权益</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="h in data">
                        <th>
                            <input type="checkbox" >
                        </th>
                        <th>{{h.RightName }}</th>
                        
                    </tr>
                   
                </tbody>
        </table>
        <input type="button"  value="分配权限" @click="AddRight">
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref, vModelCheckbox } from 'vue';
import { useRouter } from 'vue-router';
import { onMounted } from 'vue';
import type { RefSymbol } from '@vue/reactivity';



const data=ref([{

    "RightName": "",
"LevelState": true,
}])

onMounted(()=>{
    Show();
})

const Show=()=>{
    axios.get("https://localhost:7147/api/Member/GetRight",{params:data.value}).then(res=>{
        data.value=res.data;

    })
}

const rou=useRouter();

const AddRight=(val:any)=>{
    alert("成功");  
    rou.push({path:'/ShowLevelView'})
}



</script>

